/**
 * Title: jFamilyTree
 * Description: jFamilyTree mutable
 * Version: provider
 * Copyright: (c) 2001-2008
 * Terms of use:see license agreement at http://treebolic.sourceforge.net/en/license.htm
 * Author: Bernard Bou
 * Company: bsys
 * Update: Mon Mar 10 00:00:00 CEST 2008
 */
package jFamilyTree.model;

import jFamilyTree.model.IEdge;

/**
 * Extended mutable node (mutable ends, copy constructor)
 * 
 * @author Bernard Bou
 */
public class TreeMutableEdge extends MutableEdge
{
	// C O N S T R U C T O R

	/**
	 * Constructor
	 * 
	 * @param thisFrom
	 *        from node (may be null)
	 * @param thisTo
	 *        to node (may be null)
	 */
	public TreeMutableEdge(MutableNode thisFrom, MutableNode thisTo)
	{
		super(thisFrom, thisTo);
	}

	/**
	 * Copy constructor (the resulting edge has no node ends)
	 * 
	 * @param thatEdge
	 *        edge
	 */
	public TreeMutableEdge(IEdge thatEdge)
	{
		super(null, null);
		this.theColor = thatEdge.getColor();
		this.theLabel = thatEdge.getLabel();
		this.theStyle = thatEdge.getStyle();
		this.theImageFile = thatEdge.getImageFile();
	}

	// E N D S

	/**
	 * Set from-node (origin)
	 * 
	 * @param thisFromNode
	 *        from-node (may be null)
	 */
	public void setFrom(MutableNode thisFromNode)
	{
		this.theFromNode = thisFromNode;
	}

	/**
	 * Set to-node (destination)
	 * 
	 * @param thisToNode
	 *        to-node (may be null)
	 */
	public void setTo(MutableNode thisToNode)
	{
		this.theToNode = thisToNode;
	}
}
